home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 7.1 KB | 199 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Mathematica.vu
- #
- # Contains: Quick look test script for Mathematica version 2.1
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.7> 11/19/93 NAGA modify TCS format
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/23/93 KTA Added 'fpu' to gLaunchReqs as Mathematica requires an FPU.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up tools and fonts for Mathematica. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- Println("NOTE: No DoDraw - Mathematica does not have any drawing tools to test.");
- global gScreenInset := {0,20,0,0}; # Screen inset
-
- global gPaletteList := {};
- global gToolList := {};
-
- ### font characteristic lists
- global gFontSizeList := {'6','9','10','12','14','18', '24','36','48'};
- global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow'};
-
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; # InitAppGlobals
-
-
- #########################################################################
- # MathStuff()
- #========================================================================
- # Author: AEM
- # Description: does some calculation. Because of its size, Mathematica takes
- # a long time to initialize its calculation routines on the slower
- # cpus.
- # Parameters: None
- # Returns: Nothing
- # Examples: MathStuff();
- # Assumptions: None
- # Applications: Mathematica
- #========================================================================
- # History:
- #
- #########################################################################
- task MathStuff()
- begin
- logstr("Performing some calculations...");
- TypeStr("(2135+654654654)/2.3546");
- SpecialKey(enterKey,"Enter Key");
- if not (DialogCheck("",'OK',,{[window t:'Why the Beep?']}))
- begin
- TypeList({"(11+22)*(22*8)","(88*3231)/9.315","((101-145)*32123)/2.32154"},3);
- SpecialKey(enterKey,"Enter Key");
- wait(1);
- while match[window t:/Running≈/]!
- wait(2);
- end;
- else
- LogStr("Sorry, no math tests - No memory, Mathematica couldn't start local kernel");
- end;
-
- #########################################################################
- # MathematicaSetupDoText()
- #========================================================================
- # Author: KTA
- # Description: Selects LongMenus to set up DoText
- # Parameters: None
- # Returns: Nothing
- # Examples: MathematicaSetupDoText();
- # Assumptions: None
- # Applications: Mathematica
- #========================================================================
- # History:
- #
- #########################################################################
- task MathematicaSetupDoText()
- begin
- if not(match[menuItem t:'Long Menus' m:[menu t:'Edit' o:3] o:15 c:'']!)
- SelectMenuItem('Long Menus','Edit');
- end;
-
- #########################################################################
- # MathematicaPageSetup()
- #========================================================================
- # Author: KTA
- # Description: Custom Page Setup
- # Parameters: None
- # Returns: Nothing
- # Examples: MathematicaPageSetup();
- # Assumptions: None
- # Applications: Mathematica
- #========================================================================
- # History:
- #
- #########################################################################
- task MathematicaPageSetup()
- begin
- if ( WhichDevice = "LaserWriter")
- begin
- TCSStart({ 1, global kTCSetPageSetup },"Select 'Page Setup'");
- TCSEnd({ 1, global kTCSetPageSetup }, SelectMenuItem("Page Setup","Printing Options...","File")); #To select Page SetUp…
- wait(1);
- PageSetupDesc:= match[window o:1]!;
- PageSetupDescList:= {PageSetupDesc};
- TCSStart({ 2, global kTCSetPageSetup },"Dismiss the Page Setup Dialog");
- SpecialKey(returnKey, 'Return Key'); #To Select the Default-'OK'
- wait(1);
- if not FindWindow(PageSetupDescList)
- TCSEnd({ 2, global kTCSetPageSetup }, 1);
- else
- TCSEnd({ 2, global kTCSetPageSetup }, 0);
- end;
- end; # MathematicaPageSetup()
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Mathematica (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- global gApptitle := "Mathematica";
- global gAppVersion := '3'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- global glaunchreqs:= {'no68k', 'fpu'};
- SuiteStart('Mathematica.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gSetupDoText:= task MathematicaSetupDoText; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp();
- MathStuff();
- DoText();
- DoWindow();
- DoDraw(0);
- MathematicaPageSetup(); # custom page setup menuitem
- DoCloseApp(,-1,0);
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script Mathematica
-
- ## Still needed
- # 1) Vertical scroll could fail if nothing in document
-